home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 12
/
CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso
/
CUCD
/
Programming
/
PopupMenu
/
include
/
libraries
/
pm.h.auts
< prev
Wrap
Text File
|
1997-04-19
|
7KB
|
194 lines
//
// $VER: pm.h 4.1 (20.4.97)
//
// Library base, tags and macro definitions
// for popupmenu.library.
//
// ©1996-1997 Henrik Isaksson
// All Rights Reserved.
//
#ifndef LIBRARIES_POPUPMENU_H
#define LIBRARIES_POPUPMENU_H
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif
//
// Tags passed to OpenPopupMenu
//
#define PM_SubMenuTimer (TAG_USER+1) // Delay before opening submenus
#define PM_RecessSelected (TAG_USER+2) // Recess selected item
#define PM_WideSelectBar (TAG_USER+3) // Wide selectbar
#define PM_Menu (TAG_USER+4) // Pointer to menulist initialized by MakeMenu()
#define PM_Compact (TAG_USER+5) // Make the menu more compact (smaller)
#define PM_OldLook (TAG_USER+6) // Make the menu look (almost) like old intuition menus
#define PM_SameHeight (TAG_USER+7) // Make all items the same height
#define PM_CheckMark (TAG_USER+8) // Checkmark (Default: MENUCHECK)
#define PM_ExcludeMark (TAG_USER+9) // Checkmark for items with exclusion or inclusion set (Default: MXIMAGE)
#define PM_SubMenuMark (TAG_USER+10) // Menu mark (Default: RIGHTIMAGE)
#define PM_SmartRefresh (TAG_USER+11) // Smart refreshing (uses more memory, faster)
#define PM_Top (TAG_USER+12) // Top (Y) position
#define PM_Left (TAG_USER+13) // Left (X) position
#define PM_Code (TAG_USER+14) // The contents of the code field of IntuiMessage (ALWAYS!)
//
// Tags passed to MakeItem
//
#define PM_Title (TAG_USER+20) // Item title
#define PM_UserData (TAG_USER+21) // Anything, returned by OpenPopupMenu when this item is selected
#define PM_ID (TAG_USER+22) // ID number, if you want to access this item later
#define PM_Sub (TAG_USER+23) // Pointer to submenu list (from MakeMenu)
#define PM_Flags (TAG_USER+24) // For internal use
#define PM_NoSelect (TAG_USER+25) // Make the item unselectable
#define PM_FillPen (TAG_USER+26) // Make the item appear in FILLPEN
#define PM_Checkit (TAG_USER+27) // Leave space for a checkmark
#define PM_Checked (TAG_USER+28) // Make this item is checked
#define PM_Italic (TAG_USER+29) // Italic text
#define PM_Bold (TAG_USER+30) // Bold text
#define PM_Underlined (TAG_USER+31) // Underlined text
#define PM_TitleBar (TAG_USER+32) // Horizontal separator bar
#define PM_WideTitleBar (TAG_USER+33) // Same as above, but full width
#define PM_ShadowPen (TAG_USER+34) // Draw text in SHADOWPEN
#define PM_ShinePen (TAG_USER+35) // Draw text in SHINEPEN
//#define PM_CenterText (TAG_USER+36)
#define PM_Exclude (TAG_USER+37) // Items to unselect (or select) when this gets selected
#define PM_Disabled (TAG_USER+38) // Disable an item
#define PM_ImageSelected (TAG_USER+39) // Image when selected, PM_Title will be render on top of the image
#define PM_ImageUnselected (TAG_USER+40) // Image when unselected
#define PM_IconSelected (TAG_USER+41) // Icon when selected
#define PM_IconUnselected (TAG_USER+42) // Icon when unselected
//#define PM_ImageMode (TAG_USER+43)
#define PM_AutoStore (TAG_USER+44) // Pointer to BOOL reflecting the current state of the item
#define PM_TextPen (TAG_USER+45) // Pen number for text colour of this item, if you want to allocate a pen yourself
//
// Tags passed to MakeMenu
//
#define PM_Item (TAG_USER+50) // Item pointer from MakeItem
//
// Tags passed to MakeIDList
//
#define PM_ExcludeID (TAG_USER+55) // ID number of menu to deselect when this gets selected
#define PM_IncludeID (TAG_USER+56) // ID number of menu to select when this gets selected
#define PM_ReflectID (TAG_USER+57) // ID number of menu that should reflect the state of this one
#define PM_InverseID (TAG_USER+58) // ID number of menu to inverse reflect the state of this one
//
// Built-in Images
//
// /
#define IMG_CHECKMARK (0x10L) // Checkmark \/
#define IMG_RIGHTARROW (0x0CL) // SysIClass Arrow |>|
#define IMG_MXIMAGE (0x0FL) // SysIClass MX (*)
#define IMG_CHECKIMAGE (0x0EL) // SysIClass Checkbox | |
#define IMG_AMIGAKEY (0x11L) // Amiga Key Image |A|
#define IMG_BULLET_A (0x8000L) // bullet ·
#define IMG_BULLET_B (0x8100L) // 3d bullet ·
#define IMG_ARROW_A (0x8200L) // Arrow >
#define IMG_ARROW_B (0x8300L) // 3d arrow >
#define IMG_ARROW_C (0x8400L) // Arrow ->
//
// Macros
//
#define PMMenu(t) PM_MakeMenu(PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMSubMenu(t) PM_Sub, PM_MakeMenu(PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMItem(t) PM_Item, PM_MakeItem(PM_Title, t
#define PMTitleBar PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE
#define PMNarrowTitleBar PM_Item, PM_MakeItem(PM_TitleBar, TRUE
#define PMMenuTitle(t) PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMExcl PM_Exclude, PM_MakeIDList(
#define ExID(id) PM_ExcludeID, id
#define InID(id) PM_IncludeID, id
#define RefID(id) PM_ReflectID, id
#define InvID(id) PM_InverseID, id
#define PMCheckItem(t,id) PM_Item, PM_MakeItem(PM_Title, t, PM_ID, id, PM_Checkit, TRUE
#define PMEnd TAG_DONE)
#ifndef End
#define End TAG_DONE)
#endif
#define PMERR (-5L)
#ifndef LIBRARIES_BGUI_H
//
// WARNING! Theese macros are obsolete due to interference with macros
// declared by BGUI!
// The new macros are defined above
//
#define Menu(t) MakeMenu(PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define SubMenu(t) PM_Sub, MakeMenu(PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define Item(t) PM_Item, MakeItem(PM_Title, t
#define TitleBar PM_Item, MakeItem(PM_WideTitleBar, TRUE
#define NarrowTitleBar PM_Item, MakeItem(PM_TitleBar, TRUE
#define MenuTitle(t) PM_Item, MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define Excl PM_Exclude, MakeIDList(
#define ExID(id) PM_ExcludeID, id
#define InID(id) PM_IncludeID, id
#define RefID(id) PM_ReflectID, id
#define InvID(id) PM_InverseID, id
#define CheckItem(t,id) PM_Item, MakeItem(PM_Title, t, PM_ID, id, PM_Checkit, TRUE
#endif /* LIBRARIES_BGUI_H */
//
// Library base
//
struct PopupMenuBase {
struct Library pmb_Library;
ULONG pmb_SegList;
ULONG pmb_Flags;
struct Library *pmb_ExecBase;
struct Library *pmb_UtilityBase;
struct Library *pmb_IntuitionBase;
struct Library *pmb_GfxBase;
struct Library *pmb_DOSBase;
BOOL pmb_NewPrefs;
};
#define POPUPMENU_VERSION 4L
#define POPUPMENU_NAME "popupmenu.library"
#ifndef PM_NEWNAMES // The naming has changed from V2, this should provide
// backwards compatibility. (disable with #define PM_NEWNAMES)
#define MakeItem PM_MakeItem
#define MakeMenu PM_MakeMenu
#define MakeItemA PM_MakeItemA
#define MakeMenuA PM_MakeMenuA
#define FreePopupMenu PM_FreePopupMenu
#define OpenPopupMenu PM_OpenPopupMenu
#define OpenPopupMenuA PM_OpenPopupMenuA
#define MakeIDList PM_MakeIDList
#define MakeIDListA PM_MakeIDListA
#define ItemChecked PM_ItemChecked
#endif
#endif